package com.dronem;


import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.widget.TextView;

public class DronemActivity extends Activity {
    /** Called when the activity is first created. */
	
	TunerEngine tuner;
    final Handler mHandler = new Handler();
    
    TextView t;
    

    
    
    final Runnable callback = new Runnable() {
        public void run() {
         
          System.out.println("Detected frequency: " + tuner.currentFrequency);
 

          t.setText("Detected frequency: " + tuner.currentFrequency);
          

        }
    };
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        t = new TextView(this);
        t.setText("Detecting ...");
        setContentView(t);
        
        
        try {
        	
            tuner = new TunerEngine(mHandler,callback);
            tuner.start();
            
        }catch (Exception e){
        	
        	System.out.println("Bugger");
        
        }
        
        
    }
    
    public void onDestroy(){
    	
    	tuner.close();
    	
    }
    

}